#!/bin/bash -
#=======================================================================
#
#          FILE: hex2dec.sh
#         USAGE: ./hex2dec.sh <hex-number>
#   DESCRIPTION: Convert hexadecimal number to decimal
#  REQUIREMENTS: python
#          BUGS: N/A
#         NOTES: N/A
#        AUTHOR: Ali Ayoub
#         EMAIL: ali@mellanox.com
#       COMPANY: N/A
#       CREATED: 09.17.2010-15:53:28
#      REVISION: 1.0
#=======================================================================

USAGE="Usage: $0 <number>"
if [ ! $# == 1 ]; then
  echo $USAGE
  exit
fi

num=`echo $1 |tr -d x`
python -c "print int(0x$num)"
exit 0

